package com.wanli.agent.homepage.model;

import android.util.Log;

import com.google.gson.Gson;
import com.wanli.agent.MyApplication;
import com.wanli.agent.appconst.MethodType;
import com.wanli.agent.appconst.URLConst;
import com.wanli.agent.base.DataCallBack;
import com.wanli.agent.bean.AccountOpeningPermitBean;
import com.wanli.agent.bean.ActivateResultBean;
import com.wanli.agent.bean.ActiveListBean;
import com.wanli.agent.bean.AgentBean;
import com.wanli.agent.bean.AgentRankListBean;
import com.wanli.agent.bean.AgentShowBean;
import com.wanli.agent.bean.AreaListBean;
import com.wanli.agent.bean.BankCardBean;
import com.wanli.agent.bean.BankDeposiAddressListBean;
import com.wanli.agent.bean.BankGetBankBean;
import com.wanli.agent.bean.BankGetCityBean;
import com.wanli.agent.bean.BankListBean;
import com.wanli.agent.bean.BaseResponseBean;
import com.wanli.agent.bean.BranchBrankListBean;
import com.wanli.agent.bean.BusinessDataOverviewBean;
import com.wanli.agent.bean.BusinessDataTodayBean;
import com.wanli.agent.bean.BusinessMerchantInfoBean;
import com.wanli.agent.bean.BusinessProviderInfoBean;
import com.wanli.agent.bean.BusinessProviderOrMerchantInfoBean;
import com.wanli.agent.bean.ChannelTypeBean;
import com.wanli.agent.bean.DailyStatisticsBean;
import com.wanli.agent.bean.DeviceUnifyBean;
import com.wanli.agent.bean.DeviceUnifyListBean;
import com.wanli.agent.bean.DeviceUnifyNewBean;
import com.wanli.agent.bean.DeviceUnifyReceivedBean;
import com.wanli.agent.bean.DeviceUnifyReceivedNewBean;
import com.wanli.agent.bean.EBankIndustryListBean;
import com.wanli.agent.bean.ExtensionCodeBean;
import com.wanli.agent.bean.GetWxMercIdBean;
import com.wanli.agent.bean.IdCardBean;
import com.wanli.agent.bean.ImageBean;
import com.wanli.agent.bean.IncomeListBean;
import com.wanli.agent.bean.IncomeNewBean;
import com.wanli.agent.bean.IndexMessageBean;
import com.wanli.agent.bean.IndustryListBean;
import com.wanli.agent.bean.KDBAllIndustryListBean;
import com.wanli.agent.bean.LicenseInfoBean;
import com.wanli.agent.bean.MachinesInfoBean;
import com.wanli.agent.bean.MerchantBean;
import com.wanli.agent.bean.MerchantDetailsBean;
import com.wanli.agent.bean.MerchantDetailsListBean;
import com.wanli.agent.bean.MerchantIndustryNumberBean;
import com.wanli.agent.bean.MerchantShowBean;
import com.wanli.agent.bean.OrderFeeBean;
import com.wanli.agent.bean.QueryOrderBean;
import com.wanli.agent.bean.QueryOrderListBean;
import com.wanli.agent.bean.RateNewBean;
import com.wanli.agent.bean.ReturncashListBean;
import com.wanli.agent.bean.ScanActivateBean;
import com.wanli.agent.bean.ServiceProviderBean;
import com.wanli.agent.bean.StoreActiveBean;
import com.wanli.agent.bean.StoreDeatilsBean;
import com.wanli.agent.bean.StoreHuaBeiRateBean;
import com.wanli.agent.bean.StoreListBean;
import com.wanli.agent.bean.StoreStatisticsBean;
import com.wanli.agent.bean.SubBranchListBean;
import com.wanli.agent.bean.TransferAgentBean;
import com.wanli.agent.bean.TransferAgentNewBean;
import com.wanli.agent.bean.VersionBean;
import com.wanli.agent.bean.WithdrawListBean;
import com.wanli.agent.retorfit_manager.ResponseObserver;
import com.wanli.agent.retorfit_manager.RetrofitHelper;
import com.wanli.agent.utils.LogUtils;
import com.wanli.agent.utils.ToastUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class HomePageModelImpl implements IHomePageModel {

    @Override
    public void requestIndexMessage(int page, DataCallBack<IndexMessageBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MESSAGECENTER, params, new ResponseObserver<IndexMessageBean>() {
            @Override
            public void onSuccessful(IndexMessageBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IndexMessageBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDailyStatistics(String date, DataCallBack<DailyStatisticsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("date", date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DAILYSTATISTICS, params, new ResponseObserver<DailyStatisticsBean>() {
            @Override
            public void onSuccessful(DailyStatisticsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DailyStatisticsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentAdd(String mobile, String name, String password,String channel_type, DataCallBack<AgentBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile);
        params.put("name", name);
        params.put("password", password);
        params.put("channel_type", channel_type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AGENTADD, params, new ResponseObserver<AgentBean>() {
            @Override
            public void onSuccessful(AgentBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AgentBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentUpdateName(String name, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AgenUpdateName, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestShareMoneyRateNewMy(DataCallBack<RateNewBean> callBack) {
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getShareMoneyRateNewMy, null, new ResponseObserver<RateNewBean>() {
            @Override
            public void onSuccessful(RateNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(RateNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestShareMoneyRateNew(String set_agent_id, DataCallBack<RateNewBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getShareMoneyRateNew, params, new ResponseObserver<RateNewBean>() {
            @Override
            public void onSuccessful(RateNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(RateNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSetShareMoneyRateNew(String set_agent_id, List<RateNewBean.DataBean> mList, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        params.put("rate_list", new Gson().toJson(mList));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.setShareMoneyRateNew, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestVerifyBankFourFactor(String settle_name, String settle_mobile, String id_card, String card_no,String bank_name,String bank_type,String bank_city,String settle_type ,DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("settle_name", settle_name);
        params.put("settle_mobile", settle_mobile);
        params.put("id_card", id_card);
        params.put("card_no", card_no);
        params.put("bank_name", bank_name);
        params.put("bank_type", bank_type);
        params.put("bank_city", bank_city);
        params.put("settle_type", settle_type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.verifyBankFourFactor, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentIndex(int page, String has_children, String agent_field_name, String agent_field_value, String start_time, String end_time, DataCallBack<ServiceProviderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("has_children", has_children);
        params.put("agent_field_name", agent_field_name);
        params.put("agent_field_value", agent_field_value);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AGENTINDEX, params, new ResponseObserver<ServiceProviderBean>() {
            @Override
            public void onSuccessful(ServiceProviderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ServiceProviderBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantIndex(int page, int has_children, String merchant_field_value, DataCallBack<MerchantBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("has_children", has_children);
        params.put("merchant_field_value", merchant_field_value);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MERCHANTINDEX, params, new ResponseObserver<MerchantBean>() {
            @Override
            public void onSuccessful(MerchantBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentWithdrawalAdd(String money, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("money", money);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AgentWithdrawalAdd, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentWithdrawalAddFx(String money, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("money", money);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AgentWithdrawalAddFx, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentWithdrawalList(int page, String status, DataCallBack<WithdrawListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("status", status);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AgentWithdrawalList, params, new ResponseObserver<WithdrawListBean>() {
            @Override
            public void onSuccessful(WithdrawListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(WithdrawListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDailyNew(String start_date, String end_date, DataCallBack<QueryOrderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("start_date", start_date);
        params.put("end_date", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getDailyNew, params, new ResponseObserver<QueryOrderBean>() {
            @Override
            public void onSuccessful(QueryOrderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(QueryOrderBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDailyNewList(int page, String has_children, String pay_status, String store_name, String start_date, String end_date, DataCallBack<QueryOrderListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("has_children", has_children);
        params.put("pay_status", pay_status);
        params.put("store_name", store_name);
        params.put("start_time", start_date);
        params.put("end_time", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getDailyNewList, params, new ResponseObserver<QueryOrderListBean>() {
            @Override
            public void onSuccessful(QueryOrderListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(QueryOrderListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestOrderShareMoneyDetailList(int page, String store_name, String start_date, String end_date, DataCallBack<IncomeListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("store_name", store_name);
        params.put("start_time", start_date);
        params.put("end_time", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.OrderShareMoneyDetail, params, new ResponseObserver<IncomeListBean>() {
            @Override
            public void onSuccessful(IncomeListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IncomeListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestReturncashOrderDetailList(int page, String start_date, String end_date, DataCallBack<IncomeListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("start_time", start_date);
        params.put("end_time", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ReturncashOrderDetail, params, new ResponseObserver<IncomeListBean>() {
            @Override
            public void onSuccessful(IncomeListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IncomeListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceUnifyTypeReceived(DataCallBack<DeviceUnifyBean> callBack) {
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.deviceUnifyTypeReceived, null, new ResponseObserver<DeviceUnifyBean>() {
            @Override
            public void onSuccessful(DeviceUnifyBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceUnifyReceived(String type, DataCallBack<DeviceUnifyReceivedBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DeviceUnifyReceived, params, new ResponseObserver<DeviceUnifyReceivedBean>() {
            @Override
            public void onSuccessful(DeviceUnifyReceivedBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyReceivedBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceUnifyReceivedList(int page, String child_agent_id, String status, String type, String condition_name, String condition_value, DataCallBack<DeviceUnifyListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("status", status);
        params.put("child_agent_id", child_agent_id);
        params.put("type", type);
        params.put("condition_name", condition_name);
        params.put("condition_value", condition_value);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DeviceUnifyAllIndex, params, new ResponseObserver<DeviceUnifyListBean>() {
            @Override
            public void onSuccessful(DeviceUnifyListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestTransferAgent(String agent_id, String type, String prefix, String min_no, String max_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("agent_id", agent_id);
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("min_no", min_no);
        params.put("max_no", max_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.transferAgent, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSelectTransferAgent(String in_agent_id, String type, String prefix, List<String> device_no_list, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("in_agent_id", in_agent_id);
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("device_id_list", new Gson().toJson(device_no_list));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.selectTransferAgent, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestTransferAgentIndex(DataCallBack<ServiceProviderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("limit", -1);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AGENTINDEX, params, new ResponseObserver<ServiceProviderBean>() {
            @Override
            public void onSuccessful(ServiceProviderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ServiceProviderBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreIndex(DataCallBack<StoreListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("limit", -1);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.STOREINDEX, params, new ResponseObserver<StoreListBean>() {
            @Override
            public void onSuccessful(StoreListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requesTransferStore(String store_no, String type, String prefix, String min_no, String max_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("min_no", min_no);
        params.put("max_no", max_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.transferstore, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requesSelectTransferStore(String store_no, String type, String prefix, List<String> device_no_list, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("device_id_list", new Gson().toJson(device_no_list));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.selectTransferStore, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreIndex(int page, String type, DataCallBack<TransferAgentBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.agentList, params, new ResponseObserver<TransferAgentBean>() {
            @Override
            public void onSuccessful(TransferAgentBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(TransferAgentBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSonIndex(int page, String bind_agent_id, String type, DataCallBack<DeviceUnifyListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("bind_agent_id", bind_agent_id);
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.sonIndex, params, new ResponseObserver<DeviceUnifyListBean>() {
            @Override
            public void onSuccessful(DeviceUnifyListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestCancelTransferAgent(String min_no, String max_no, String prefix, String type, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("min_no", min_no);
        params.put("max_no", max_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.cancelTransferAgent, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSelectCancelTransferAgent(List<String> device_no_list, String prefix, String type, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        params.put("prefix", prefix);
        params.put("device_id_list", new Gson().toJson(device_no_list));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.selectCancelTransferAgent, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceUnifyShow(String id, DataCallBack<MachinesInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DeviceUnifyShow, params, new ResponseObserver<MachinesInfoBean>() {
            @Override
            public void onSuccessful(MachinesInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MachinesInfoBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceEnable(String id, String no, String qrcode, String prefix, DataCallBack<ScanActivateBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        params.put("no", no);
        params.put("qrcode", qrcode);
        params.put("prefix", prefix);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.deviceEnable, params, new ResponseObserver<ScanActivateBean>() {
            @Override
            public void onSuccessful(ScanActivateBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ScanActivateBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestReturncashOrderShow(String order_no, DataCallBack<ActivateResultBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ReturncashOrderShow, params, new ResponseObserver<ActivateResultBean>() {
            @Override
            public void onSuccessful(ActivateResultBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ActivateResultBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestTestCloudHorn(String full_code, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("full_code", full_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.testCloudHorn, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestBankGetCity(String bank_name, String bank_area, DataCallBack<BankGetCityBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name);
        params.put("bank_area", bank_area);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.BANKGETCITY, params, new ResponseObserver<BankGetCityBean>() {
            @Override
            public void onSuccessful(BankGetCityBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankGetCityBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestBankGetBranch(String bank_name, String bank_area, String bank_city, DataCallBack<BankGetCityBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name);
        params.put("bank_area", bank_area);
        params.put("bank_city", bank_city);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.BANKGETBRANCH, params, new ResponseObserver<BankGetCityBean>() {
            @Override
            public void onSuccessful(BankGetCityBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankGetCityBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestBankGetBranchKDB(String bank_name, String bank_city, DataCallBack<BankGetBankBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("bankName", bank_name);
        params.put("cityName", bank_city);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getBandCodeByBankNameCityName, params, new ResponseObserver<BankGetBankBean>() {
            @Override
            public void onSuccessful(BankGetBankBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankGetBankBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestIndustryIndex(DataCallBack<IndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", 1);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.IndustryIndex, params, new ResponseObserver<IndustryListBean>() {
            @Override
            public void onSuccessful(IndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IndustryListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestUploadFile(String dir_name, String file, DataCallBack<ImageBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("dir_name", dir_name);
        params.put("file", "data:image/png;base64," + file);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.UploadFile, params, new ResponseObserver<ImageBean>() {
            @Override
            public void onSuccessful(ImageBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ImageBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliIdCard(String file_path, String side, DataCallBack<IdCardBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        params.put("side", side);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALIIDCARD, params, new ResponseObserver<IdCardBean>() {
            @Override
            public void onSuccessful(IdCardBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IdCardBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliLicenseInfo(String file_path, DataCallBack<LicenseInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALILICENSEINFO, params, new ResponseObserver<LicenseInfoBean>() {
            @Override
            public void onSuccessful(LicenseInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(LicenseInfoBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliBankCard(String file_path, DataCallBack<BankCardBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALIBANKCARD, params, new ResponseObserver<BankCardBean>() {
            @Override
            public void onSuccessful(BankCardBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankCardBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestAccountOpeningPermit(String file_path, DataCallBack<AccountOpeningPermitBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALIBANKACCOUNTPERMIT, params, new ResponseObserver<AccountOpeningPermitBean>() {
            @Override
            public void onSuccessful(AccountOpeningPermitBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AccountOpeningPermitBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreIncomeProfile(String merchant_id, int quick_income, String merchant_type, String merchant_name, String user_wx, String contact_name, String legal_name,
                                          String contact_mobile, String password, String legal_id_card_no, String legal_id_card_start,
                                          String legal_id_card_end, String province, String city, String area, String address, String lng,
                                          String lat, String license_no, String license_full_name, String license_address,
                                          String license_start, String license_end, String shop_type, String settle_to, String industry_id,
                                          String rate, String legal_flag, String unincorporated_id,String unincorporated_name,String account_type, String branch, String holder,
                                          String holder_id_card_no, String holder_mobile, String bank_card_no, String door_pic,
                                          String inside_pic, String cashier_desk_pic, String license_pic, String bank_card_front_pic,
                                          String legal_id_card_front_pic, String legal_id_card_back_pic, String legal_id_card_hand_pic,
                                          String non_leg_settle_auth_pic, String non_leg_idcard_front_pic, String non_leg_idcard_back_pic,
                                          String terminal_type, String collect_pic, String collect_pic_two, String merchant_register_pic, String settlement_cycle,
                                          String reg_capital, String kdb_province_id, String kdb_city_id, String kdb_area_id, String kdb_bank_code, int crp_profession, int crp_gender, String legal_mobile, String email, String bank, String bank_card_back_pic,String unionpay,String bank_type,String branch_province,String branch_city,String open_acc_area,String bank_account_permit_pic,String channel_type,String mcc_cd,
                                          DataCallBack<BaseResponseBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("merchant_id", merchant_id == null ? "" : merchant_id);
        params.put("quick_income", quick_income);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("user_wx", user_wx == null ? "" : user_wx);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("password", password == null ? "" : password);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("shop_type", shop_type == null ? "" : shop_type);
        params.put("settle_to", settle_to == null ? "" : settle_to);
        params.put("industry_id", industry_id == null ? "" : industry_id);
        params.put("rate", rate == null ? "" : rate);
        params.put("legal_flag",legal_flag);
        params.put("unincorporated_id",unincorporated_id);
        params.put("unincorporated_name",unincorporated_name);
        params.put("account_type", account_type == null ? "" : account_type);
        params.put("branch", branch == null ? "" : branch);
        params.put("holder", holder == null ? "" : holder);
        params.put("holder_id_card_no", holder_id_card_no == null ? "" : holder_id_card_no);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("non_leg_settle_auth_pic", non_leg_settle_auth_pic == null ? "" : non_leg_settle_auth_pic);
        params.put("non_leg_idcard_front_pic", non_leg_idcard_front_pic == null ? "" : non_leg_idcard_front_pic);
        params.put("non_leg_idcard_back_pic", non_leg_idcard_back_pic == null ? "" : non_leg_idcard_back_pic);
        params.put("terminal_type", terminal_type == null ? "" : terminal_type);
        params.put("collect_pic", collect_pic == null ? "" : collect_pic);
        params.put("collect_pic_two", collect_pic_two == null ? "" : collect_pic_two);
        params.put("merchant_register_pic", merchant_register_pic == null ? "" : merchant_register_pic);
        params.put("mcc_code", mcc_cd);
        params.put("crp_profession", crp_profession);
        params.put("crp_gender", crp_gender);
        params.put("legal_mobile", legal_mobile == null ? "" : legal_mobile);
        params.put("email", email == null ? "" : email);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("bank_card_back_pic", bank_card_back_pic == null ? "" : bank_card_back_pic);
        params.put("settlement_cycle", settlement_cycle == null ? "" : settlement_cycle);
        params.put("reg_capital", reg_capital == null ? "" : reg_capital);
        params.put("kdb_province_id", kdb_province_id == null ? "" : kdb_province_id);
        params.put("kdb_city_id", kdb_city_id == null ? "" : kdb_city_id);
        params.put("kdb_area_id", kdb_area_id == null ? "" : kdb_area_id);
        params.put("kdb_bank_code", kdb_bank_code == null ? "" : kdb_bank_code);
        params.put("bank", bank == null ? "" : bank);
        params.put("bank_type", bank_type == null ? "" : bank_type);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("open_acc_area", open_acc_area == null ? "" : open_acc_area);
        params.put("bank_account_permit_pic", bank_account_permit_pic == null ? "" : bank_account_permit_pic);
        params.put("channel_type", channel_type == null ? "" : channel_type);
        params.put("mcc_cd", mcc_cd == null ? "" : mcc_cd);
        String s = new Gson().toJson(params);
        LogUtils.e("新增门店 开店宝",s);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.incomeProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });

    }

    @Override
    public void requestStoreSaveProfile(String store_no, int quick_income, String merchant_type, String merchant_name, String user_wx, String contact_name, String legal_name,
                                        String contact_mobile, String legal_id_card_no, String legal_id_card_start,
                                        String legal_id_card_end, String province, String city, String area, String address, String lng,
                                        String lat, String license_no, String license_full_name, String license_address,
                                        String license_start, String license_end, String shop_type, String settle_to, String industry_id,
                                        String rate, String legal_flag, String unincorporated_id,String unincorporated_name,String account_type, String branch, String holder,
                                        String holder_id_card_no, String holder_mobile, String bank_card_no, String door_pic,
                                        String inside_pic, String cashier_desk_pic, String license_pic, String bank_card_front_pic,
                                        String legal_id_card_front_pic, String legal_id_card_back_pic, String legal_id_card_hand_pic,
                                        String non_leg_settle_auth_pic, String non_leg_idcard_front_pic, String non_leg_idcard_back_pic,
                                        String terminal_type, String collect_pic, String collect_pic_two, String merchant_register_pic, String settlement_cycle,
                                        String reg_capital, String kdb_province_id, String kdb_city_id, String kdb_area_id, String kdb_bank_code, int crp_profession, int crp_gender, String legal_mobile, String email, String bank, String bank_card_back_pic,String unionpay,String bank_type,String branch_province,String branch_city,String open_acc_area,String bank_account_permit_pic,String channel_type,String mcc_cd,
                                        DataCallBack<BaseResponseBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no == null ? "" : store_no);
        params.put("quick_income", quick_income);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("user_wx", user_wx == null ? "" : user_wx);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("shop_type", shop_type == null ? "" : shop_type);
        params.put("settle_to", settle_to == null ? "" : settle_to);
        params.put("industry_id", industry_id == null ? "" : industry_id);
        params.put("rate", rate == null ? "" : rate);
        params.put("legal_flag",legal_flag);
        params.put("unincorporated_id",unincorporated_id);
        params.put("unincorporated_name",unincorporated_name);
        params.put("account_type", account_type == null ? "" : account_type);
        params.put("branch", branch == null ? "" : branch);
        params.put("holder", holder == null ? "" : holder);
        params.put("holder_id_card_no", holder_id_card_no == null ? "" : holder_id_card_no);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("non_leg_settle_auth_pic", non_leg_settle_auth_pic == null ? "" : non_leg_settle_auth_pic);
        params.put("non_leg_idcard_front_pic", non_leg_idcard_front_pic == null ? "" : non_leg_idcard_front_pic);
        params.put("non_leg_idcard_back_pic", non_leg_idcard_back_pic == null ? "" : non_leg_idcard_back_pic);
        params.put("terminal_type", terminal_type == null ? "" : terminal_type);
        params.put("collect_pic", collect_pic == null ? "" : collect_pic);
        params.put("collect_pic_two", collect_pic_two == null ? "" : collect_pic_two);
        params.put("merchant_register_pic", merchant_register_pic == null ? "" : merchant_register_pic);
        params.put("mcc_code", mcc_cd);
        params.put("crp_profession", crp_profession);
        params.put("crp_gender", crp_gender);
        params.put("legal_mobile", legal_mobile == null ? "" : legal_mobile);
        params.put("email", email == null ? "" : email);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("bank_card_back_pic", bank_card_back_pic == null ? "" : bank_card_back_pic);
        params.put("settlement_cycle", settlement_cycle == null ? "" : settlement_cycle);
        params.put("reg_capital", reg_capital == null ? "" : reg_capital);
        params.put("kdb_province_id", kdb_province_id == null ? "" : kdb_province_id);
        params.put("kdb_city_id", kdb_city_id == null ? "" : kdb_city_id);
        params.put("kdb_area_id", kdb_area_id == null ? "" : kdb_area_id);
        params.put("kdb_bank_code", kdb_bank_code == null ? "" : kdb_bank_code);
        params.put("bank", bank == null ? "" : bank);
        params.put("bank_type", bank_type == null ? "" : bank_type);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("open_acc_area", open_acc_area == null ? "" : open_acc_area);
        params.put("bank_account_permit_pic", bank_account_permit_pic == null ? "" : bank_account_permit_pic);
        params.put("channel_type", channel_type == null ? "" : channel_type);
        params.put("mcc_cd", mcc_cd == null ? "" : mcc_cd);

        String s = new Gson().toJson(params);
        LogUtils.e("保存门店资料",s);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.saveProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });

    }

    @Override
    public void requestEBankStoreSaveProfile(String store_no, String merchant_type, String merchant_name, String license_no,
                                             String license_full_name, String license_address, String license_start, String license_end, String license_pic,
                                             String province, String city, String area, String address, String lng, String lat, String contact_name,
                                             String contact_mobile, String legal_name, String legal_id_card_no,
                                             String legal_id_card_start, String legal_id_card_end, String bank,
                                             String branch, String branch_province, String branch_city,
                                             String bank_card_no, String holder_mobile, String unionpay,
                                             String door_pic, String bank_card_front_pic,
                                             String legal_id_card_front_pic, String legal_id_card_back_pic,
                                             String legal_id_card_hand_pic,
                                             String inside_pic, String cashier_desk_pic, String sign_pic, String mcc_code, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no == null ? "" : store_no);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("bank", bank == null ? "" : bank);
        params.put("branch", branch == null ? "" : branch);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("mcc_code", mcc_code);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("account_type", "0");
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("sign_pic", sign_pic == null ? "" : sign_pic);

        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DianYinSaveProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestEBankStoreIncomeProfile(String merchant_type, String merchant_name, String password, String license_no,
                                               String license_full_name, String license_address, String license_start, String license_end, String license_pic,
                                               String province, String city, String area,
                                               String address, String lng, String lat, String contact_name,
                                               String contact_mobile, String legal_name,
                                               String legal_id_card_no, String legal_id_card_start,
                                               String legal_id_card_end, String bank, String branch,
                                               String branch_province, String branch_city,
                                               String bank_card_no, String holder_mobile, String unionpay,
                                               String door_pic, String bank_card_front_pic,
                                               String legal_id_card_front_pic, String legal_id_card_back_pic,
                                               String legal_id_card_hand_pic, String inside_pic, String cashier_desk_pic, String sign_pic, String mcc_code,
                                               DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("password", password == null ? "" : password);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("bank", bank == null ? "" : bank);
        params.put("branch", branch == null ? "" : branch);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("mcc_code", mcc_code);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("account_type", "0");
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("sign_pic", sign_pic == null ? "" : sign_pic);

        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DianYinIncomeProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreSendSignSms(String store_no, DataCallBack<MerchantShowBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.sendSignSms, params, new ResponseObserver<MerchantShowBean>() {
            @Override
            public void onSuccessful(MerchantShowBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantShowBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantShow(String id, DataCallBack<MerchantDetailsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MerchantShow, params, new ResponseObserver<MerchantDetailsBean>() {
            @Override
            public void onSuccessful(MerchantDetailsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantDetailsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreProfile(String store_no, DataCallBack<StoreDeatilsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreProfile, params, new ResponseObserver<StoreDeatilsBean>() {
            @Override
            public void onSuccessful(StoreDeatilsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreDeatilsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestGetWxMercId(String store_no, String ys_merc_id ,DataCallBack<GetWxMercIdBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("ys_merc_id", ys_merc_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getWxMercId, params, new ResponseObserver<GetWxMercIdBean>() {
            @Override
            public void onSuccessful(GetWxMercIdBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(GetWxMercIdBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestReturncashOrder(String order_no, DataCallBack<ReturncashListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ReturncashOrder, params, new ResponseObserver<ReturncashListBean>() {
            @Override
            public void onSuccessful(ReturncashListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ReturncashListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSharefliterSum(DataCallBack<OrderFeeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.SharefliterSum, params, new ResponseObserver<OrderFeeBean>() {
            @Override
            public void onSuccessful(OrderFeeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderFeeBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSharefliterSumNew(String relation_type,DataCallBack<OrderFeeBean> callBack) {
        Map<String, Object> params = new HashMap<>();

        if (!"".equals(relation_type)){
            params.put("relation_type", relation_type);
        }


        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.fliterSumNew, params, new ResponseObserver<OrderFeeBean>() {
            @Override
            public void onSuccessful(OrderFeeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderFeeBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestReturnfliterSum(DataCallBack<OrderFeeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ReturnfliterSum, params, new ResponseObserver<OrderFeeBean>() {
            @Override
            public void onSuccessful(OrderFeeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderFeeBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreFilterCount(DataCallBack<StoreActiveBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreFilterCount, params, new ResponseObserver<StoreActiveBean>() {
            @Override
            public void onSuccessful(StoreActiveBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreActiveBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreFilterIndex(int page, String type, DataCallBack<ActiveListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("type", type);//(new,high_quality,silence)
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreFilterIndex, params, new ResponseObserver<ActiveListBean>() {
            @Override
            public void onSuccessful(ActiveListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ActiveListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetStoreHuaBeiRate(String store_no, DataCallBack<StoreHuaBeiRateBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetStoreHuaBeiRate, params, new ResponseObserver<StoreHuaBeiRateBean>() {
            @Override
            public void onSuccessful(StoreHuaBeiRateBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreHuaBeiRateBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSetStoreHuaBeiRate(String store_no, String rate, String yinsheng_change_pic,DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("rate", rate);
        params.put("yinsheng_change_pic", yinsheng_change_pic);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.SetStoreHuaBeiRate, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetProvince(DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetProvince, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetCity(int province_code, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("province_code", province_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetCity, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetRegion(int code, int level, DataCallBack<BankDeposiAddressListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("code", code);
        params.put("level", level);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getRegion, params, new ResponseObserver<BankDeposiAddressListBean>() {
            @Override
            public void onSuccessful(BankDeposiAddressListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankDeposiAddressListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requestGetBank(String  bank_name,DataCallBack<BankListBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name == null ? "" : bank_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getBank, params, new ResponseObserver<BankListBean>() {
            @Override
            public void onSuccessful(BankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requesGetOpenBank(String bank_type, String city_code, DataCallBack<SubBranchListBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("bank_type", bank_type);
        params.put("city_code", city_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getOpenBank, params, new ResponseObserver<SubBranchListBean>() {
            @Override
            public void onSuccessful(SubBranchListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(SubBranchListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requestGetArea(int city_code, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("city_code", city_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetArea, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetBankName(String bank_name, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name == null ? "" : bank_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetBankName, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetBranchBankName(int page, String key, String bank_name, String province_name, String city_name, DataCallBack<BranchBrankListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("key", key);
        params.put("bank_name", bank_name == null ? "" : bank_name);
        params.put("province_name", province_name == null ? "" : province_name);
        params.put("city_name", city_name == null ? "" : city_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetBankCode, params, new ResponseObserver<BranchBrankListBean>() {
            @Override
            public void onSuccessful(BranchBrankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BranchBrankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeStoreCloseStatus(String store_no, String is_close, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("is_close", is_close);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ChangeStoreCloseStatus, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeAgentWithdrawLimit(String set_agent_id, String limit, String agent_line, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        params.put("limit", limit);
        params.put("agent_line", agent_line);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ChangeAgentWithdrawLimit, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeAgentLoginLimit(String set_agent_id, String limit, String agent_line, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        params.put("limit", limit);
        params.put("agent_line", agent_line);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.changeAgentLoginLimit, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeAgentIncomeLimit(String set_agent_id, String limit, String agent_line, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        params.put("limit", limit);
        params.put("agent_line", agent_line);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.changeAgentIncomeLimit, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeAgentInviteLimit(String set_agent_id, String limit, String agent_line, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("set_agent_id", set_agent_id);
        params.put("limit", limit);
        params.put("agent_line", agent_line);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.changeAgentInviteLimit, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentShow(String id, DataCallBack<AgentShowBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AgentShow, params, new ResponseObserver<AgentShowBean>() {
            @Override
            public void onSuccessful(AgentShowBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AgentShowBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentGetParents(String check_agent_id, DataCallBack<AgentRankListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("check_agent_id", check_agent_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetParents, params, new ResponseObserver<AgentRankListBean>() {
            @Override
            public void onSuccessful(AgentRankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AgentRankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAgentGetChilds(String check_agent_id, DataCallBack<AgentRankListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("check_agent_id", check_agent_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetChilds, params, new ResponseObserver<AgentRankListBean>() {
            @Override
            public void onSuccessful(AgentRankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AgentRankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetStoreStatistics(DataCallBack<StoreStatisticsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetStoreStatistics, params, new ResponseObserver<StoreStatisticsBean>() {
            @Override
            public void onSuccessful(StoreStatisticsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreStatisticsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetStoreStatisticsEach(int page, String type, String merchant_field_value, String start_time, String end_time, DataCallBack<MerchantDetailsListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("type", type);
        params.put("limit", 50);
        params.put("merchant_field_value", merchant_field_value);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetStoreStatisticsEach, params, new ResponseObserver<MerchantDetailsListBean>() {
            @Override
            public void onSuccessful(MerchantDetailsListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantDetailsListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSaveNewStatus(String message_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("message_no", message_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.saveNewStatus, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestClientVersion(DataCallBack<VersionBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("oem_no", MyApplication.getOem_no());
        params.put("app_type", "Agent");
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.clientVersion, params, new ResponseObserver<VersionBean>() {
            @Override
            public void onSuccessful(VersionBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(VersionBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMoneyDetailIsNew(DataCallBack<IncomeNewBean> callBack) {
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.moneyDetailIsNew, null, new ResponseObserver<IncomeNewBean>() {
            @Override
            public void onSuccessful(IncomeNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IncomeNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMoneyDetailIndexNew(int page, String store_name, String start_date, String end_date,String relation_type, DataCallBack<IncomeListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("store_name", store_name);
        params.put("start_time", start_date);
        params.put("end_time", end_date);

        if (!"".equals(relation_type)){
            params.put("relation_type", relation_type);
        }

        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.moneyDetailIndexNew, params, new ResponseObserver<IncomeListBean>() {
            @Override
            public void onSuccessful(IncomeListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IncomeListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChildDeviceStatistics(String child_agent_id, DataCallBack<DeviceUnifyNewBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("child_agent_id", child_agent_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.childDeviceStatistics, params, new ResponseObserver<DeviceUnifyNewBean>() {
            @Override
            public void onSuccessful(DeviceUnifyNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChildDeviceStatisticsByUse(String child_agent_id, String type, DataCallBack<DeviceUnifyReceivedNewBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("child_agent_id", child_agent_id);
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.childDeviceStatisticsByUse, params, new ResponseObserver<DeviceUnifyReceivedNewBean>() {
            @Override
            public void onSuccessful(DeviceUnifyReceivedNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceUnifyReceivedNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChildDeviceNotBelong(int page, String child_agent_id, String type, DataCallBack<TransferAgentNewBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", -1);
        params.put("child_agent_id", child_agent_id);
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.childDeviceNotBelong, params, new ResponseObserver<TransferAgentNewBean>() {
            @Override
            public void onSuccessful(TransferAgentNewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(TransferAgentNewBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestIndustryType(String mcc_type, DataCallBack<EBankIndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("mcc_type", mcc_type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getMcc, params, new ResponseObserver<EBankIndustryListBean>() {
            @Override
            public void onSuccessful(EBankIndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(EBankIndustryListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestKDBIndustryType(DataCallBack<KDBAllIndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.findAnyBusiness, params, new ResponseObserver<KDBAllIndustryListBean>() {
            @Override
            public void onSuccessful(KDBAllIndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(KDBAllIndustryListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestGetMcc(DataCallBack<MerchantIndustryNumberBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.storeGetMcc, params, new ResponseObserver<MerchantIndustryNumberBean>() {
            @Override
            public void onSuccessful(MerchantIndustryNumberBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantIndustryNumberBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void agentCode(DataCallBack<ExtensionCodeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.agentCode, params, new ResponseObserver<ExtensionCodeBean>() {
            @Override
            public void onSuccessful(ExtensionCodeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ExtensionCodeBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestGetAgentType(String qr_code_data, DataCallBack<ChannelTypeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("qr_code_data", qr_code_data);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getAgentType, params, new ResponseObserver<ChannelTypeBean>() {
            @Override
            public void onSuccessful(ChannelTypeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ChannelTypeBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }


    @Override
    public void getBusinessDataToday(String product_version, DataCallBack<BusinessDataTodayBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("product_version", product_version);
        LogUtils.e("经营数据req","getBusinessDataToday - Url：" + URLConst.getBusinessDataToday);
        LogUtils.e("经营数据req","getBusinessDataToday：" + new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getBusinessDataToday, params, new ResponseObserver<BusinessDataTodayBean>() {
            @Override
            public void onSuccessful(BusinessDataTodayBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BusinessDataTodayBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void getDataOverview(String product_version, String by_day, String by_month, String start_time, String end_time, DataCallBack<BusinessDataOverviewBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("product_version", product_version);
        params.put("by_day", by_day);
        params.put("by_month", by_month);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        LogUtils.e("经营数据req","getDataOverview - Url：" + URLConst.getDataOverview);
        LogUtils.e("经营数据req","getDataOverview：" + new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getDataOverview, params, new ResponseObserver<BusinessDataOverviewBean>() {
            @Override
            public void onSuccessful(BusinessDataOverviewBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BusinessDataOverviewBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void getProviderInfo(String product_version, String agent_id, int page_size, int page_num, String agent_search, String by_day, String by_month, String start_time, String end_time, String money_sort, String store_sort, DataCallBack<BusinessProviderInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("product_version", product_version);
        params.put("agent_id", agent_id);
        params.put("page_size", page_size);
        params.put("page_num", page_num);
        params.put("agent_search", agent_search);
        params.put("by_day", by_day);
        params.put("by_month", by_month);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        params.put("money_sort", money_sort);
        params.put("store_sort", store_sort);
        LogUtils.e("经营数据req","getProviderInfo - Url：" + URLConst.getProviderInfo);
        LogUtils.e("经营数据req","getProviderInfo：" + new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getProviderInfo, params, new ResponseObserver<BusinessProviderInfoBean>() {
            @Override
            public void onSuccessful(BusinessProviderInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BusinessProviderInfoBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void getMerchantInfo(String product_version, String agent_id, int page_size, int page_num, String store_search, String by_day, String by_month, String start_time, String end_time, String money_sort, String store_sort, DataCallBack<BusinessMerchantInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("product_version", product_version);
        params.put("agent_id", agent_id);
        params.put("page_size", page_size);
        params.put("page_num", page_num);
        params.put("store_search", store_search);
        params.put("by_day", by_day);
        params.put("by_month", by_month);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        params.put("money_sort", money_sort);
        params.put("store_sort", store_sort);
        LogUtils.e("经营数据req","getMerchantInfo - Url：" + URLConst.getMerchantInfo);
        LogUtils.e("经营数据req","getMerchantInfo：" + new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getMerchantInfo, params, new ResponseObserver<BusinessMerchantInfoBean>() {
            @Override
            public void onSuccessful(BusinessMerchantInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BusinessMerchantInfoBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void getProviderOrMerchantInfo(String product_version, String agent_id, int page_size, int page_num, String agent_search, String store_search, String by_day, String by_month, String start_time, String end_time, String money_sort, String store_sort, int roleFlag, DataCallBack<BusinessProviderOrMerchantInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("product_version", product_version);
        params.put("agent_id", agent_id);
        params.put("page_size", page_size);
        params.put("page_num", page_num);
        params.put("agent_search", agent_search);
        params.put("store_search", store_search);
        params.put("by_day", by_day);
        params.put("by_month", by_month);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        params.put("money_sort", money_sort);
        params.put("store_sort", store_sort);
        String url = URLConst.getProviderInfo;
        if (roleFlag == 0) {
            url = URLConst.getProviderInfo;
        } else if (roleFlag == 1) {
            url = URLConst.getMerchantInfo;
        }
        LogUtils.e("经营数据req","getProviderOrMerchantInfo - Url：" + url);
        LogUtils.e("经营数据req","getProviderOrMerchantInfo：" + new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, url, params, new ResponseObserver<BusinessProviderOrMerchantInfoBean>() {
            @Override
            public void onSuccessful(BusinessProviderOrMerchantInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BusinessProviderOrMerchantInfoBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }
}
